Optimal. Leaf size=38 \[ -\frac {a A \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac {a A \cot (c+d x) \csc (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {4043, 2691,
3855} \begin {gather*} \frac {a A \cot (c+d x) \csc (c+d x)}{2 d}-\frac {a A \tanh ^{-1}(\cos (c+d x))}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2691
Rule 3855
Rule 4043
Rubi steps
\begin {align*} \int \csc (c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx &=-\left ((a A) \int \cot ^2(c+d x) \csc (c+d x) \, dx\right )\\ &=\frac {a A \cot (c+d x) \csc (c+d x)}{2 d}+\frac {1}{2} (a A) \int \csc (c+d x) \, dx\\ &=-\frac {a A \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac {a A \cot (c+d x) \csc (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(79\) vs. \(2(38)=76\).
time = 0.04, size = 79, normalized size = 2.08 \begin {gather*} -a A \left (-\frac {\csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}+\frac {\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}-\frac {\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {\sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 62, normalized size = 1.63
method | result | size |
norman | \(\frac {\frac {A a}{8 d}-\frac {A a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {A a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) | \(57\) |
derivativedivides | \(\frac {-A a \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) | \(62\) |
default | \(\frac {-A a \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) | \(62\) |
risch | \(-\frac {A a \left ({\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}+\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}-\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}\) | \(79\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 68, normalized size = 1.79 \begin {gather*} -\frac {A a {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + 4 \, A a \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 86 vs.
\(2 (34) = 68\).
time = 3.54, size = 86, normalized size = 2.26 \begin {gather*} -\frac {2 \, A a \cos \left (d x + c\right ) + {\left (A a \cos \left (d x + c\right )^{2} - A a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (A a \cos \left (d x + c\right )^{2} - A a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - A a \left (\int \left (- \csc {\left (c + d x \right )}\right )\, dx + \int \csc ^{3}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 101 vs.
\(2 (34) = 68\).
time = 0.44, size = 101, normalized size = 2.66 \begin {gather*} \frac {2 \, A a \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) + \frac {A a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {{\left (A a + \frac {2 \, A a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}{\cos \left (d x + c\right ) - 1}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.26, size = 56, normalized size = 1.47 \begin {gather*} \frac {A\,a\,\left (4\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+1\right )}{8\,d\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________